/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package puntoventa.modelo;

import puntoventa.modelo.Menus;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author infor
 */
@Entity
@Table(name = "formularios", catalog = "pv", schema = "public")
@NamedQueries({
    @NamedQuery(name = "Formularios.findAll", query = "SELECT f FROM Formularios f"),
    @NamedQuery(name = "Formularios.findByIdFormularios", query = "SELECT f FROM Formularios f WHERE f.idFormularios = :idFormularios"),
    @NamedQuery(name = "Formularios.findByNombreFormularios", query = "SELECT f FROM Formularios f WHERE f.nombreFormularios = :nombreFormularios"),
    @NamedQuery(name = "Formularios.findByTextoFormularios", query = "SELECT f FROM Formularios f WHERE f.textoFormularios = :textoFormularios"),
    @NamedQuery(name = "Formularios.findByIconoFormularios", query = "SELECT f FROM Formularios f WHERE f.iconoFormularios = :iconoFormularios"),
    @NamedQuery(name = "Formularios.findByEjecutarFormularios", query = "SELECT f FROM Formularios f WHERE f.ejecutarFormularios = :ejecutarFormularios")})
public class Formularios implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_formularios")
    private Integer idFormularios;
    @Column(name = "nombre_formularios")
    private String nombreFormularios;
    @Column(name = "texto_formularios")
    private String textoFormularios;
    @Column(name = "icono_formularios")
    private String iconoFormularios;
    @Column(name = "ejecutar_formularios")
    private String ejecutarFormularios;
    @JoinColumn(name = "id_menus", referencedColumnName = "id_menus")
    @ManyToOne
    private Menus idMenus;

    public Formularios() {
    }

    public Formularios(Integer idFormularios) {
        this.idFormularios = idFormularios;
    }

    public Integer getIdFormularios() {
        return idFormularios;
    }

    public void setIdFormularios(Integer idFormularios) {
        Integer oldIdFormularios = this.idFormularios;
        this.idFormularios = idFormularios;
        changeSupport.firePropertyChange("idFormularios", oldIdFormularios, idFormularios);
    }

    public String getNombreFormularios() {
        return nombreFormularios;
    }

    public void setNombreFormularios(String nombreFormularios) {
        String oldNombreFormularios = this.nombreFormularios;
        this.nombreFormularios = nombreFormularios;
        changeSupport.firePropertyChange("nombreFormularios", oldNombreFormularios, nombreFormularios);
    }

    public String getTextoFormularios() {
        return textoFormularios;
    }

    public void setTextoFormularios(String textoFormularios) {
        String oldTextoFormularios = this.textoFormularios;
        this.textoFormularios = textoFormularios;
        changeSupport.firePropertyChange("textoFormularios", oldTextoFormularios, textoFormularios);
    }

    public String getIconoFormularios() {
        return iconoFormularios;
    }

    public void setIconoFormularios(String iconoFormularios) {
        String oldIconoFormularios = this.iconoFormularios;
        this.iconoFormularios = iconoFormularios;
        changeSupport.firePropertyChange("iconoFormularios", oldIconoFormularios, iconoFormularios);
    }

    public String getEjecutarFormularios() {
        return ejecutarFormularios;
    }

    public void setEjecutarFormularios(String ejecutarFormularios) {
        String oldEjecutarFormularios = this.ejecutarFormularios;
        this.ejecutarFormularios = ejecutarFormularios;
        changeSupport.firePropertyChange("ejecutarFormularios", oldEjecutarFormularios, ejecutarFormularios);
    }

    public Menus getIdMenus() {
        return idMenus;
    }

    public void setIdMenus(Menus idMenus) {
        Menus oldIdMenus = this.idMenus;
        this.idMenus = idMenus;
        changeSupport.firePropertyChange("idMenus", oldIdMenus, idMenus);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFormularios != null ? idFormularios.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Formularios)) {
            return false;
        }
        Formularios other = (Formularios) object;
        if ((this.idFormularios == null && other.idFormularios != null) || (this.idFormularios != null && !this.idFormularios.equals(other.idFormularios))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "puntoventa.formulario.Formularios[ idFormularios=" + idFormularios + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
